package per.com.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import per.com.bean.*;
import per.com.bean.others.*;
import per.com.dao.DeviceCategoryDao;

import javax.annotation.Resource;


@Controller
@RequestMapping("/api")
public class DeviceCategoryController {

    @Resource
    public DeviceCategoryDao deviceCategoryDao;

    @RequestMapping("/getCurtains")
    @ResponseBody
    public BaseBean<CurtainBean> getAllCurtain(){
        return new BaseBean<CurtainBean>(0,"success",deviceCategoryDao.selectAllCurtain());
    }

    @RequestMapping("/getLamps")
    @ResponseBody
    public BaseBean<LampBean> getLamps(){
        return new BaseBean<LampBean>(0,"success",deviceCategoryDao.selectAllLamp());
    }

    @RequestMapping("/getTvs")
    @ResponseBody
    public BaseBean<TVBean> getTv(){
        return new BaseBean<TVBean>(0,"success",deviceCategoryDao.selectAllTv());
    }

    @RequestMapping("/getAirs")
    @ResponseBody
    public BaseBean<AirBean> getAir(){
        return new BaseBean<AirBean>(0,"success",deviceCategoryDao.selectAllAir());
    }

    @RequestMapping("/getStates")
    @ResponseBody
    public BaseBean<SceneStateBean> getState(){
        return new BaseBean<SceneStateBean>(0,"success",deviceCategoryDao.selectAllState());
    }

}
